#include "IndexedArray.h"

#ifdef INDEXED_ARRAY_HPP

/*
*	Constructors
*/
template <typename TYPE, int MAX>
IndexedArray<TYPE, MAX>::IndexedArray() {
	this->count = 0;
} //IndexedArray

/*
*	Operators
*/
template <typename TYPE, int MAX>
TYPE IndexedArray<TYPE, MAX>::get(int index) {
	if (index >= MAX || index < 0) throw(EXCEPTION_OUT_OF_BOUNDS);

	return values[index];
} //get

template <typename TYPE, int MAX>
int IndexedArray<TYPE, MAX>::getCount() {
	return count;
} //getCount

/*
*	Methods
*/
template <typename TYPE, int MAX>
void IndexedArray<TYPE, MAX>::insert(TYPE value) {
	if (count == MAX) throw(EXCEPTION_OVERFLOW);

	values[count++] = value;
} //insert

#endif